<!--
 * @Author: libing 9852442+liu-sheng-8667@user.noreply.gitee.com
 * @Date: 2024-04-12 21:56:10
 * @LastEditors: xuezhuangzhuang xzz6996@qq.com
 * @LastEditTime: 2025-06-30 22:29:44
 * @FilePath: \crm\pages\customer\my-customer.vue
 * @Description: 我的客户
-->
<template>
  <view class="my-customer">
    <u-navbar title="我的客户" :autoBack="true" bgColor="transparent">
      <!-- <template #right>
        <text
          style="font-size: 26rpx; color: #dc2626; margin-right: 200rpx"
          @click="onCreateHandle"
          >新建</text
        >
      </template> -->
    </u-navbar>
    <view class="search-wrap">
      <u-search
        placeholder="请输入客户名称"
        v-model="keyword"
        bgColor="#FFFFFF"
        height="68rpx"
        placeholderColor="#C1C5C9"
        :showAction="false"
        @change="upper"
        actionText="新建"
        @custom="onCreateHandle"
        :actionStyle="actionStyle"
      />
	  <div style="height: 10px"></div>
      <u-search
        placeholder="请输入客户手机号"
        v-model="phone"
        bgColor="#FFFFFF"
        height="68rpx"
        placeholderColor="#C1C5C9"
        :showAction="false"
		actionText=" "
        @change="upper"
        :actionStyle="actionStyle"
      />
    </view>
    <view class="bg"></view>
    <scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower">
      <!-- 无限滚动列表 -->
      <view v-for="(item, index) in list" :key="index" class="wrap">
        <CompanyItem
          isActive
          :item="item"
          :customerTypesObj="customerTypesObj"
          @jump="toCustomerInfoPage(item)"
        />
      </view>
      <u-loadmore iconType="circle" :status="status" />
    </scroll-view>
  </view>
</template>
<script>
import CompanyItem from "./conponents/company-item.vue";
import listPageMixins from "./mixins/scroll-list";
import { getCompanyListPage } from "@/apis/customer/index";
import asyncSelect from "./mixins/async-select";
export default {
  name: "my-customer",
  components: {
    CompanyItem,
  },
  mixins: [listPageMixins, asyncSelect],
  data() {
    return {
      keyword: "",
      queryAPI: getCompanyListPage,
      actionStyle: {
        width: "100rpx",
        color: "#DC2626",
      },
      defaltParams: {
        highSeas: 0,
      },
	  phone: ""
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    onCreateHandle() {
      uni.navigateTo({
        url: "/pagesform/form/customer-form",
      });
    },
  },
};
</script>
<style scoped lang="scss">
.scroll-Y {
  height: calc(100vh - 320rpx);
}

.my-customer {
  height: 100vh;
  padding: 0 18rpx;
  background: #f2f4f5;

  .bg {
    height: 659rpx;
    background: linear-gradient(#f4eae9 0%, #f4e9e8 10%, #f2f4f5 100%);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

.wrap {
  background: #ffffff;
  border-radius: 16rpx;
  padding: 24rpx 0;
  margin-bottom: 20rpx;
}

.search-wrap {
  margin-bottom: 20rpx;
  position: relative;
  z-index: 100;
  margin-top: 20rpx;
}
</style>
